<?php
	session_start();
	ob_start();
	function __autoload($TenLop)
	{
		include_once "classes/" . $TenLop . ".php";
	}
	include_once "thuvien.php";
?>
<script type="text/javascript">
			function thongbao()
			{
				var tem=document.getElementsByClassName('TenSP').item(0).innerHTML;
				alert("Đã thêm "+tem+" vào giỏ hàng");
			}
</script>
<html>
	<head>
   		<meta charset="utf-8" />
    	<title>Sản phẩm</title>
        <link rel="stylesheet" type="text/css" href="css/sanpham.css">
         <script type="text/javascript" src="scripts/tinybox.js"></script>
    </head>
    <body>
    	<div id="main">
        	<!--TOP-->
        	<div id="top">
            	<?php include_once "topper.php"; ?>
            </div>
            <!--EMD TOP-->
            <div class="clr"></div>
            <!--Content-->
            <div id="main_content">
            	<div id="show">
                	<div class="sanpham_detail">
                    	 <?php
							$sanpham = new sanphambs();
							$danhsach = $sanpham->GetList_New();
						
								$hinhanh = new hinhanhbs();
								$hinhanh->MaSanPham = $danhsach['0']['MaSanPham'];
								$dshinh = $hinhanh->GetList();
								echo " <li>
								 <div class='slider_hinhsp'><a href='index.php?do=chitietsanpham&msp={$danhsach[0]['MaSanPham']}'>
									<img src='{$dshinh[0]['patch']}' width='200px' height='250px'/>
								 </a>
								 </div>
									
								 <div class='slider_thongtinsp'>
								 <h2 class='TenSP'>". $danhsach[0]['TenSanPham']."</h2>
								 <p class='luotxem'>" . $danhsach[0]['LuotXem'] . " lượt xem</p>
								<span class='GiaBan'> " . number_format($danhsach[0]['DonGia']) . " VNĐ</span>
								
								 <table>
									
									<tr> <td><span class='thongtin_sp'>Chất liệu: </span></td><td>". $danhsach[0]['TenChatLieu']."</td></tr>
									<tr> <td><span class='thongtin_sp'>Màu Sắc: </span></td><td>". $danhsach[0]['MauSac']."</tr>
									<tr> <td><span class='thongtin_sp'>Kiểu dáng: </span></td><td>". $danhsach[0]['KieuDang']."</td></tr>
									<tr> <td><span class='thongtin_sp'>Kích thước:</span></td><td>". $danhsach[0]['KichThuoc']."</td></tr>
									<tr> <td><span class='thongtin_sp'> Xuất xứ:</span></td><td>". $danhsach[0]['TenNhaSX']."</td></tr>
									
								 </table>
								 
								 <span class='themgiohang'>
								 <a onClick='thongbao()' href='index.php?do=giohang&id={$danhsach[0]['MaSanPham']}'><img src='images/themgiohang.png' class='giohang' />
								 </a>
								 </span>
									
								 </div>
								 
								</li>";
							
						?>
                    </div>
                    
                    <span class='giohang'>
                        <a href='index.php?do=giohang'><img src="images/giohang.gif" width="120px" /></a>
                    </span>
                    <span class='thanhtoan'>
                        <a href='index.php?do=thanhtoan'><img src="images/thanhtoan.png" width="120px" /></a>
                    </span>
                    
                    <?php
                        echo "<div class='MoTa'>{$danhsach[0]['MoTa']}</div>";
                    ?>
                  
		
                </div>
                <div id="menu_right">
                	<div class="box_menu">
							<h2>Tìm kiếm</h2>
							<ul>
								<form action="index.php?do=home_timkiem" method="post" class="timkiemsp">
                                    Sản phẩm cần tìm: <input type="text" style="width:150px;" name="key" />
                                    <select name="loai" class="timkiem">
                                        <option value='0'>Sản phẩm</option>
                                        <option value='1'>Nhà sản xuất</option>
                                        <option value='2'>Màu sắc</option>
                                        <option value='3'>Loại sản phẩm</option>
                                        <option value='4'>Chất liệu</option>
                                        <option value='5'>Nhóm hàng</option>
                                    </select>
                                    <input type="submit" value="Tìm kiếm" name="TimKiem" class="btn_timkiem" />
                                </form>
							</ul>
						</div>
                </div>
            </div>
            <!--END Conetne-->
             <div class="clr"></div>
			<div id="footer">
            	<p>
                	Bản quản &copy; Lê Thành Được 12-09-2014
                </p>
			</div>
        </div>
    </body>
</html>